using System;
using System.Collections.Generic;
using System.Text;

namespace Acms.DataControls
{
    [System.ComponentModel.Designer(typeof(RolesDataSourceDesigner))]
    [System.Web.UI.ToolboxData("<{0}:RolesDataSource runat=server/>")]
    public class RolesDataSource : GenericDataSource<Bll.Role>
    {

    }

    public class RolesDataSourceDesigner : GenericDataSourceDesigner<Bll.Role>
    {

        protected override Acms.Bll.Role GetDesignTimeItem(int index)
        {
            Random rnd = new Random(index);
            string[] names = new string[]{"Developer", "ContentEditor", "UserManager", "Approver"};
            Acms.Bll.Role tmp = Acms.Bll.Role.CreateInstance();
            tmp.Name = names[rnd.Next(0, names.Length)];
            tmp.IsAdminRole = rnd.Next(0, 1) == 1;
            return tmp;
        }
    }
}
